#include <vga.h>
#include <string.h>
#include <i386.h>
#include <syscalls.h>
#include <tipos.h>
#include <fs.h>
#include <stdio.h>
#define PS 4096
int main(void) {

	stdio_init();
	FILE_DESC serial;
	
	serial = open("/serial0", FS_OPEN_RDWR);

	stdio_print("TAREA 3!\n");

	stdio_print("TEST 1 / 4 \n");
	int i;
	for (i = 0; i < 10; i++) {
		write(serial, "A", 1);
	}
	
	stdio_print("TEST 2 / 4 \n");
	char * buf = palloc();

	//breakpoint();
	memset(buf, 'B', PS);
	//breakpoint();
	write(serial, buf, PS);
	//breakpoint();
	
	stdio_print("TEST 3 / 4 \n");
	memset(buf, 'A', PS);
	write(serial, buf, PS);
	
	stdio_print("TEST 4 / 4 \n");
	memset(buf, 'D', PS);
	write(serial, buf, PS);
	
	stdio_print("DONE !!");
	stdio_wait();
	
	stdio_close();
	return 0;
}
